package store.lunangangster.engine.impl.repository;

import store.lunangangster.engine.ProcessEngineConfiguration;
import store.lunangangster.engine.bpmn.parser.BpmnParsers;
import store.lunangangster.engine.impl.entity.DeploymentEntity;

/**
 * {@link DeploymentParseBuilder}的工厂类，拥有一个实例
 *
 * @author cwk
 * @version 1.0
 */
public class DeploymentParseBuilderFactory {

  protected ProcessEngineConfiguration processEngineConfiguration;
  protected BpmnParsers bpmnParsers;

  public DeploymentParseBuilderFactory(ProcessEngineConfiguration processEngineConfiguration) {
    this.processEngineConfiguration = processEngineConfiguration;
    this.bpmnParsers = processEngineConfiguration.getBpmnParser();
  }

  public DeploymentParseBuilder createBuilderForDeployment(DeploymentEntity deployment) {
    return new DeploymentParseBuilder(deployment, bpmnParsers);
  }
}
